package com.sgb.kjwl.repository.impl;

import com.sgb.kjwl.model.api.ApiSource;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.supplier3.SupplierRecommendEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.sgb.kjwl.repository.TransportRepertory;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

public class TransportRepertoryImpl extends BaseRepertoryImpl implements TransportRepertory {

    private final ApiSource apiSource;

    public TransportRepertoryImpl(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        super(apiSource, preferenceSource);
        this.apiSource = (ApiSource) apiSource;
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getSupplierCityData(String areacode) {
        return apiSource.getSupplierCityData(areacode).compose(rxSchedulerHelper());
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getSupplierMapData(Map map) {
        return apiSource.getSupplierMapData(map).compose(rxSchedulerHelper());
    }


}
